package com.baby.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

public class WordConsumerListener implements MessageListener {
    @Override
    public void onMessage(Message message) {
        System.out.println("工作交换机为"+message.getMessageProperties().getReceivedExchange());
        System.out.println("工作路由key"+message.getMessageProperties().getReceivedRoutingKey());
        System.out.println("工作消息的id为"+message.getMessageProperties().getDeliveryTag());
        System.out.println("工作消息的唯一标识符"+message.getMessageProperties().getConsumerTag());
        System.out.println("工作消息的本身为"+new String(message.getBody()));
    }
}
